<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Person() {
        this.name = "zce";
        this.age = 16;
      }

      let p1 = new Person();
      console.log(p1.age);

      function Persson1() {
        this.name = "zce";
        this.age = 15;
        // 多加了一层访问层级，速度比Person直接访问age要慢
        this.getAge = function () {
          return this.age;
        };
      }
      let p2 = Persson1();
      console.log(p2.getAge());
    </script>
  </body>
</html>
